package com.itheima.demo;

import com.itheima.service.UserService;
import com.itheima.service.impl.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");
        //UserService us = ac.getBean(UserService.class);
        UserServiceImpl us = (UserServiceImpl) ac.getBean("userService",UserService.class);
        us.say();
        String byName = us.findByName();
        System.out.println(byName);
    }
}
